package Q3;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String str1 = scanner.next();
        String str2 = scanner.next();
        int len1 = str1.length();
        int len2 = str2.length();

        System.out.println(Math.abs(len1 - len2));
    }
}
